package com.example.xm.controller;

import com.example.xm.entity.Huiyuan;
import com.example.xm.entity.Tiaozhan;
import com.example.xm.service.IHuiyuanService;
import com.example.xm.service.ITiaozhanService;
import com.example.xm.web.Result;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/tiaozhan")
public class TiaozhanController {
    @Autowired
    ITiaozhanService shipinfenleiService;
    @PostMapping("/add")
    public Result reg(@RequestBody Tiaozhan gonggao){
        System.out.println("user"+gonggao);
        shipinfenleiService.reg(gonggao);
        return Result.success();
    }
    @GetMapping("/list")
    public Result list(Integer uid){
        List<Tiaozhan> pageInfo= shipinfenleiService.list(uid);
        return Result.success(pageInfo);
    }
}
